package com.pagepub.expo.manager;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.flex.remoting.RemotingDestination;
import org.springframework.flex.remoting.RemotingInclude;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.pagepub.expo.dao.AppSeqDao;

@Service
@Transactional
@RemotingDestination(channels = { "my-amf", "my-secure-amf" })
public class AppSeqMng {

	@Autowired
	private AppSeqDao appSeqDao;


	@RemotingInclude
	@Transactional(propagation = Propagation.NOT_SUPPORTED, readOnly = true)
	public Long getDefault() {
		return new Long(appSeqDao.getDefault());
	}
	
	@RemotingInclude
	@Transactional(propagation = Propagation.NOT_SUPPORTED, readOnly = true)
	public Long getSequence(String sequence) {
		return new Long(appSeqDao.getSequence(sequence));
	}
	
}
